package es.ats.codington.festival.mappers;

import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.sql.ResultSet;

import es.ats.codington.festival.domain.Event;
import es.ats.codington.festival.domain.Visitor;

public class VisitorMapper implements RowMapper<Visitor>{
	
	@Override
	public Visitor mapRow(ResultSet rs, int nRow) throws SQLException{
		Visitor visitor= new Visitor();		
		
		visitor.setPeopleId(rs.getInt("peopleId"));
		visitor.setFirstName(rs.getString("firstName"));
		visitor.setLastName(rs.getString("lastName"));
		visitor.setUserName(rs.getString("userName"));
		visitor.setEmail(rs.getString("email"));
		visitor.setDni(rs.getString("dni"));
		visitor.setnPhone(rs.getString("nPhone"));
		visitor.setAddress(rs.getString("address"));
		visitor.setPassword(rs.getString("password"));
		visitor.setAdmin(rs.getBoolean("isAdmind"));
		
		return visitor;
		
	}
}
